<template>
    <div id="app" class="sharechatroom" style="height: 100%;">
        <loading v-if="loading"></loading>
        <div v-else>
            <say-footer></say-footer>
            <div class="share_controller center">
                <div class="room_cover_bg relative">
                    <!-- charRoom.cover-->
                    <img :src="charRoom.cover" class="room_cover absolute">
                </div>
                <!-- v-text="charRoom.title" -->
                <p class="room_name center" v-text="charRoom.title"></p>
                <!--  v-text="'ID:'+charRoom.beautiful_id" -->
                <p class="room_id center" v-text="'ID:'+charRoom.beautiful_id"></p>
                <img src="../../../assets/img/share_say.png"class="share_say">
                <div class="join center" @click="downloadSayHi">我要加入</div>
            </div>
        </div>
      </div>
    </div>
</template>
<script>
import './index.css';
import common from 'assets/js/common';
import Loading from "components/loading.vue"
import SayFooter from "components/footer.vue"
import download from 'assets/js/download.js';
export default {  
  data(){
    return {
        loading:false,
        platform:'',
        charRoom:{},
        roomId:''
    }
  },
  components:{ Loading,SayFooter },
  mounted:function(){
      this.platform = common.platform;
      this.roomId = common.getQueryString('id');
      this.getchatRoomInfo();
  },
  methods: {
      //获取在线用户列表
      getchatRoomInfo:function(){
          common.ajax({
              type:'get',
              url:'api/share/chatroom/'+this.roomId 
          }).then(res=>{
              this.loading = false;
              this.charRoom = res.data;
          })
      },
      downloadSayHi(){
          download.openApp();
      }
  }
} 
</script>

